<div class="fm-content">
  <div class="title">
    <i nz-icon [type]="'desktop'"></i>
    &nbsp;&nbsp;留言板
  </div>
  <div class="clwork">
    <div class="top">
      <nz-tree-select class="fm-input first-input" [(ngModel)]="fs.queryObject['siteId']" nzPlaceHolder="站点"
        [nzMultiple]="false" [nzDropdownMatchSelectWidth]="true" [nzDropdownStyle]="{ 'max-height': '300px' }"
        [nzAsyncData]="true" [nzNodes]="sideDic.treeDatas" (ngModelChange)="treeClick($event)">
      </nz-tree-select>
      <nz-select class="fm-input" [(ngModel)]="fs.queryObject['type']" [nzPlaceHolder]="'类型'">
        <nz-option *ngFor="let option of modeDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
        </nz-option>
        <nz-option *ngIf="modeDic.isLoading" nzDisabled nzCustomContent>
          <i nz-icon type="loading" class="loading-icon"></i>加载中...
        </nz-option>
      </nz-select>
      <input nz-input placeholder="标题" class="fm-input" [(ngModel)]="fs.queryObject['title:like']" />
      <nz-button-group class="fm-search-input">
        <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
        <button nz-button (click)="reset()">重置</button>
      </nz-button-group>
      <div class="tool-right">
        <nz-button-group>
          <!-- <button nz-button [nzType]="'primary'" (click)="editRow(null)">新增</button> -->
          <button nz-popconfirm nzTitle="确认删除选择项?" (nzOnConfirm)="fs.delEntitys()" nzPlacement="bottomRight"
            nz-button>删除</button>
        </nz-button-group>
      </div>
    </div>

    <div class="left top-left">
      <ul nz-menu style="background-color: #fbfbfb;">
        <ng-container *ngFor="let data of fs.statisdatas">
          <ng-container>
            <li *ngIf="fs.statisname==data.name" (click)="fs.selectStatistics(data);" nz-menu-item nzSelected>
              {{data.name}}
              <span class="important-font">({{data.count}})</span>
            </li>
            <li *ngIf="fs.statisname!=data.name" (click)="fs.selectStatistics(data);" nz-menu-item>
              {{data.name}}
              <span class="important-font">({{data.count}})</span>
            </li>
          </ng-container>
        </ng-container>
      </ul>
    </div>

    <div class="right top-right">
      <div class="table">
        <nz-table nzSize="middle" nzShowSizeChanger [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]'
          [nzFrontPagination]="false" [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing"
          [nzTotal]="fs.rowsCount" [(nzPageIndex)]="fs.pageIndex" [(nzPageSize)]="fs.pageSize"
          (nzPageIndexChange)="fs.loadData()" (nzPageSizeChange)="fs.loadData(true)">
          <thead>
            <tr>
              <th nzWidth="80px" nzShowCheckbox [(nzChecked)]="fs.allChecked" [nzIndeterminate]="fs.indeterminate"
                (nzCheckedChange)="fs.checkAll($event)"></th>
              <th>标题</th>
              <th nzWidth="180px">时间</th>
              <th nzWidth="100px">是否回复</th>
              <th nzWidth="100px">状态</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let data of fs.datas">
              <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="fs.refreshCheckStatus()">
              </td>
              <td>
                <span (click)="editRow(data)" class="form-edit">
                  {{data.title | length:20}}<br />
                  <span style="font-size: 12px;">[{{data.siteName}}]-[{{data.typeName}}]</span>
                </span>
              </td>
              <td>{{data.messageTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
              <td>
                <label *ngIf="data.replycontent==null || data.replycontent==''">否</label>
                <label *ngIf="data.replycontent!=null && data.replycontent!=''">是</label>
              </td>
              <td>{{data.stateName}}</td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </div>
  </div>
</div>
